<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.lmpop.trade.ti_company.*" %>
<%@page import="com.lmpop.trade.ts_area.*" %>
<%@page import="com.lmpop.trade.ts_category.*" %>
<%@page import="com.lmpop.trade.tb_commpara.*" %>
<%@page import="com.lmpop.trade.ts_custclass.*" %>
<%@page import="com.lmpop.trade.ti_custlevel.*" %>
<%@page import="com.lmpop.trade.ti_attach.Ti_attachInfo" %>
<%@page import="java.util.*" %>
<html>
  <head>
    
    <title>审核企业信息</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Ts_areaInfo.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Ts_categoryInfo.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Tb_commparaInfo.js'></script>
	
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/engine.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/util.js'></script>
	
	<script type='text/javascript' src='js_customer.js'></script>
	<script type='text/javascript' src='js_commen.js'></script>
	
	<script type="text/javascript" src="/program/plugins/calendar/WdatePicker.js"></script>
</head>

<body>

  <% 
  
	Ti_attachInfo attachMgr = new Ti_attachInfo();
	


	Ts_categoryInfo classBean = new Ts_categoryInfo();
	Ts_areaInfo areaBean = new Ts_areaInfo();
	Tb_commparaInfo paraBean = new Tb_commparaInfo();
  	String cust_id="";
  	if(request.getParameter("cust_id")!=null) cust_id = request.getParameter("cust_id");
	
	String file_path = attachMgr.getFilePathByAttachrootid(cust_id);

	Ti_custlevelInfo custLevelInfo = new Ti_custlevelInfo();
	List custLevel_list = custLevelInfo.getListByPk(cust_id);
	Hashtable custLevel_map = new Hashtable();	
	if(custLevel_list!=null && custLevel_list.size()>0) custLevel_map = (Hashtable)custLevel_list.get(0);
	
	String cust_start_date = "";
	if(custLevel_map.get("cust_start_date")!=null){
	cust_start_date = custLevel_map.get("cust_start_date").toString();
	if(cust_start_date.length()>10)cust_start_date=cust_start_date.substring(0,10);
	}
	String cust_end_date = "";
	if(custLevel_map.get("cust_end_date")!=null){
	cust_end_date = custLevel_map.get("cust_end_date").toString();
	if(cust_end_date.length()>10)cust_end_date=cust_end_date.substring(0,10);
	}	
	String user_class = "";
	if(custLevel_map.get("cust_class")!=null){
	user_class = custLevel_map.get("cust_class").toString();
	}		
	Map custclassinfoMap = new Hashtable();
	custclassinfoMap.put("class_type","0");	
	Ts_custclassInfo custclassinfo = new Ts_custclassInfo();
	String custclass_select =  custclassinfo.getSelectString(custclassinfoMap,user_class);
	
  	Ti_companyInfo ti_companyInfo = new Ti_companyInfo();
  	List list = ti_companyInfo.getListByPk(cust_id);
  	Hashtable map = new Hashtable();
  	if(list!=null && list.size()>0) map = (Hashtable)list.get(0);
  	
   	if(list!=null && list.size()>0) map = (Hashtable)list.get(0);
  	
  	String short_name="",company_rage="",company_supply="",company_stock="",company_type="",client_status="",company_key="",main_product="",company_desc="",class_attr="",area_attr="",phone="",fax="",company_addr="",business_addr="",post_code="",email="",website="",contact_name="",contact_depart="",contact_job="",contact_sex="",contact_cellphone="",contact_msn="",contact_qq="",reg_money_type="",reg_money="",reg_date="",reg_addr="",corporate="",reg_no="",tax_no="",company_code="",bank_code="",bank_no="",make_sum="",staff_num="",kwo_num="",brand_name="",month_sum="",month_unit="",year_in="",year_out="",year_sum="",man_auth="",control_type="",main_market="",main_cust="",isoem="",in_date="",pub_user_id="",remark="";
	String cust_name="";
	if(map.get("cust_name")!=null) cust_name = map.get("cust_name").toString();
  	if(map.get("short_name")!=null) short_name = map.get("short_name").toString();
  	if(map.get("company_rage")!=null) company_rage = map.get("company_rage").toString();
  	if(map.get("company_supply")!=null) company_supply = map.get("company_supply").toString();
  	if(map.get("company_stock")!=null) company_stock = map.get("company_stock").toString();
  	if(map.get("company_type")!=null) company_type = map.get("company_type").toString();
  	if(map.get("client_status")!=null) client_status = map.get("client_status").toString();
  	if(map.get("company_key")!=null) company_key = map.get("company_key").toString();
  	if(map.get("main_product")!=null) main_product = map.get("main_product").toString();
  	if(map.get("company_desc")!=null) company_desc = map.get("company_desc").toString();
  	if(map.get("class_attr")!=null) class_attr = map.get("class_attr").toString();
  	if(map.get("area_attr")!=null) area_attr = map.get("area_attr").toString();
  	if(map.get("phone")!=null) phone = map.get("phone").toString();
  	if(map.get("fax")!=null) fax = map.get("fax").toString();
  	if(map.get("company_addr")!=null) company_addr = map.get("company_addr").toString();
  	if(map.get("business_addr")!=null) business_addr = map.get("business_addr").toString();
  	if(map.get("post_code")!=null) post_code = map.get("post_code").toString();
  	if(map.get("email")!=null) email = map.get("email").toString();
  	if(map.get("website")!=null) website = map.get("website").toString();
  	if(map.get("contact_name")!=null) contact_name = map.get("contact_name").toString();
  	if(map.get("contact_depart")!=null) contact_depart = map.get("contact_depart").toString();
  	if(map.get("contact_job")!=null) contact_job = map.get("contact_job").toString();
  	if(map.get("contact_sex")!=null) contact_sex = map.get("contact_sex").toString();
  	if(map.get("contact_cellphone")!=null) contact_cellphone = map.get("contact_cellphone").toString();
  	if(map.get("contact_msn")!=null) contact_msn = map.get("contact_msn").toString();
  	if(map.get("contact_qq")!=null) contact_qq = map.get("contact_qq").toString();
  	if(map.get("reg_money_type")!=null) reg_money_type = map.get("reg_money_type").toString();
  	if(map.get("reg_money")!=null) reg_money = map.get("reg_money").toString();
  	if(map.get("reg_date")!=null) reg_date = map.get("reg_date").toString();
  	if(map.get("reg_addr")!=null) reg_addr = map.get("reg_addr").toString();
  	if(map.get("corporate")!=null) corporate = map.get("corporate").toString();
  	if(map.get("reg_no")!=null) reg_no = map.get("reg_no").toString();
  	if(map.get("tax_no")!=null) tax_no = map.get("tax_no").toString();
  	if(map.get("company_code")!=null) company_code = map.get("company_code").toString();
  	if(map.get("bank_code")!=null) bank_code = map.get("bank_code").toString();
  	if(map.get("bank_no")!=null) bank_no = map.get("bank_no").toString();
  	if(map.get("make_sum")!=null) make_sum = map.get("make_sum").toString();
  	if(map.get("staff_num")!=null) staff_num = map.get("staff_num").toString();
  	if(map.get("kwo_num")!=null) kwo_num = map.get("kwo_num").toString();
  	if(map.get("brand_name")!=null) brand_name = map.get("brand_name").toString();
  	if(map.get("month_sum")!=null) month_sum = map.get("month_sum").toString();
  	if(map.get("month_unit")!=null) month_unit = map.get("month_unit").toString();
  	if(map.get("year_in")!=null) year_in = map.get("year_in").toString();
  	if(map.get("year_out")!=null) year_out = map.get("year_out").toString();
  	if(map.get("year_sum")!=null) year_sum = map.get("year_sum").toString();
  	if(map.get("man_auth")!=null) man_auth = map.get("man_auth").toString();
  	if(map.get("control_type")!=null) control_type = map.get("control_type").toString();
  	if(map.get("main_market")!=null) main_market = map.get("main_market").toString();
  	if(map.get("main_cust")!=null) main_cust = map.get("main_cust").toString();
  	if(map.get("isoem")!=null) isoem = map.get("isoem").toString();
  	if(map.get("in_date")!=null) in_date = map.get("in_date").toString();
  	if(map.get("pub_user_id")!=null) pub_user_id = map.get("pub_user_id").toString();
  	if(map.get("remark")!=null) remark = map.get("remark").toString();

	String custTypeSelect = new Tb_commparaInfo().getSelectItem("12",company_type);

	
		String areaAttr = "",classAttr = "";
			
		if (map.get("area_attr") != null) {
		area_attr = map.get("area_attr").toString();
		String areaArr[] = area_attr.split("\\|");
		for( int k = 0; k < areaArr.length; k++ ){
			areaAttr = areaAttr + " &nbsp; " + areaBean.getAreaNameById( areaArr[k]);
		}
	}
	if (map.get("class_attr") != null) {
		class_attr = map.get("class_attr").toString();
		String classArr[] = class_attr.split("\\|");
		for( int i = 0; i < classArr.length; i++ ){
			classAttr = classAttr + " &nbsp; " + classBean.getCatNameById( classArr[i]);
		}
	}

	System.out.println("------------>"+client_status);
			//取企业经营模式
		String flag0 = "" ,flag1 = "" ,flag2 = "",flag3 ="" ,flag4 = "";
		StringTokenizer client1 = new StringTokenizer(client_status,"|");
			String client2 = "";
			while (client1.hasMoreTokens()){
				client2 = client1.nextToken();
				if(client_status.indexOf("4") == -1){
					if(client2.equals("0")){flag0 = "0";}
					if(client2.equals("1")){flag1 = "0";}
					if(client2.equals("2")){flag2 = "0";}
					if(client2.equals("3")){flag3 = "0";}
				}
			if(client2.equals("4")){flag4 = "0";}
		}
		
		
	String s_company_name = "",s_area_attr="",s_class_attr="",s_email="",s_recommend="",s_StartDate="",s_EndDate="",s_cust_state="",s_company_class="",s_StartServiceDate2="",s_StartServiceDate1="",s_EndServiceDate2="",s_EndServiceDate1="";
	if(request.getParameter("search_company_name")!=null && !request.getParameter("search_company_name").equals("")){
		s_company_name = request.getParameter("search_company_name");
	}
	if(request.getParameter("search_area_attr")!=null && !request.getParameter("search_area_attr").equals("")){
		s_area_attr = request.getParameter("search_area_attr");
	}
	if(request.getParameter("search_class_attr")!=null && !request.getParameter("search_class_attr").equals("")){
		s_class_attr = request.getParameter("search_class_attr");
	}

	if(request.getParameter("search_email")!=null && !request.getParameter("search_email").equals("")){
		s_email = request.getParameter("search_email");
	}

	if(request.getParameter("search_cust_state")!=null && !request.getParameter("search_cust_state").equals("")){
		s_cust_state = request.getParameter("search_cust_state");
	}
						
	if(request.getParameter("search_company_class")!=null && !request.getParameter("search_company_class").equals("")){
		s_company_class = request.getParameter("search_company_class");
	}

	if(request.getParameter("search_recommend")!=null && !request.getParameter("search_recommend").equals("")){
		s_recommend = request.getParameter("search_recommend");
	}
	
	
	if(request.getParameter("search_StartDate")!=null && !request.getParameter("search_StartDate").equals("")){
		s_StartDate = request.getParameter("search_StartDate");
	}
	
	
	if(request.getParameter("search_EndDate")!=null && !request.getParameter("search_EndDate").equals("")){
		s_EndDate = request.getParameter("search_EndDate");
	}
	
	
	if(request.getParameter("search_StartServiceDate2")!=null && !request.getParameter("search_StartServiceDate2").equals("")){
		s_StartServiceDate2 = request.getParameter("search_StartServiceDate2");
	}
	
	if(request.getParameter("search_StartServiceDate1")!=null && !request.getParameter("search_StartServiceDate1").equals("")){
		s_StartServiceDate1 = request.getParameter("search_StartServiceDate1");
	}	
	if(request.getParameter("search_EndServiceDate2")!=null && !request.getParameter("search_EndServiceDate2").equals("")){
		s_EndServiceDate2 = request.getParameter("search_EndServiceDate2");
	}	
	
	
	if(request.getParameter("search_EndServiceDate1")!=null && !request.getParameter("search_EndServiceDate1").equals("")){
		s_EndServiceDate1 = request.getParameter("search_EndServiceDate1");
	}	
	String iStart = "0";
	if(request.getParameter("iStart")!=null) iStart = request.getParameter("iStart");
	
  %>
	
	<h1>审核企业信息</h1>
	<form action="/doTradeReg.do" method="post" name="addForm">
	<table width="100%" class="listtab" cellpadding="1" cellspacing="1" border="0">
	
			<tr>
				<td colspan="4">
			   &nbsp;&nbsp;<img src="/program/admin/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">企业基本信息</span></td>
		    </tr>	
		<tr>
			<td align="right" width="15%"  >
				企业名称:
			</td>
			<td ><%=cust_name%></td>
			<td align="right" width="10%">
				企业级别:
			</td>
			<td>
			<select value="" name="user_class" style="width:145px" id="user_class" disabled>
					<%=custclass_select%>
			</select>
			<input type="hidden" name="cust_class" id="cust_class" value="">
		</tr>
			<tr>
				<td align="right" width="10%">
					服务开始时间:
				</td>
				<td>
				<%=cust_start_date%>
				</td>
				<td align="right" width="10%">
					服务结束时间:
				</td>
				<td >
					<%=cust_end_date%>
				</td>
			</tr>			
		</tr>
		
		<tr>
			<td align="right" width="10%">
				企业网站二级域名:
			</td>
			<td  colspan="3"><%=short_name%></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				企业LOGO:
			</td>
			<td  colspan="3">
				<%
					if(!file_path.equals("")){
				%>
					<img src="<%=file_path%>" onload="if(this.width>200)this.width=200;"/>
				<%
					}else{
					out.println("无企业图片.");
					}
				%>
			</td>
		</tr>
						

		<tr>
			<td align="right" width="10%">
				企业类别:
			</td>
			<td  colspan="3">
				<%if(company_rage.equals("1")){%>销售<%}%>
				<%if(company_rage.equals("0")){%>采购<%}%>
				<%if(company_rage.equals("2")){%>销售和采购<%}%>
			</td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				
			</td>
			<td  colspan="3">
			
			<div id="xiaoshou" style="float:left;display:inline;white-space:nowrap">
					<font color="red">销售</font>产品
					<%=company_supply%>
			</div>
			<div id="caigou" style="display:none;float:left;white-space:nowrap">
				<font color="red">采购</font>产品
				<%=company_stock%>
			</div>
	
			</td>
		</tr>
		
		
		<tr>
			<td align="right" width="10%">
				企业类型:
			</td>
			<td  colspan="3">
			<select  name="company_type" id="company_type" disabled  width="30">
			<%=custTypeSelect%>
			</select>
			</td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				经营模式:
			</td>
			<td  colspan="3">
				<%if(flag0=="0"){%>生产加工<%}%>
				<%if(flag1=="0"){%>经销批发<%}%>
				<%if(flag2=="0"){%>招商代理<%}%>
				<%if(flag3=="0"){%>商业服务<%}%>
			
			</td>
		</tr>
		
		

		<tr>
			<td align="right" width="10%">
				公司关键字:
			</td>
			<td  colspan="3"><%=company_key%></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				公司主营产品:
			</td>
			<td  colspan="3">
			
			<%=main_product%>
			
			</td>
		</tr>

		<!--// fixed by Zhouxq -->
		<tr>
			<td align="right" width="15%">
				企业分类:
			</td>
			<td align="left" colspan="3">
				<%=classAttr%>
			</td>
		</tr>			
		<!--// fixed by Zhouxq -->
			<tr>					
			<td align="right" width="10%">
				所在地区:
			</td>
			<td colspan="3">
				<%=areaAttr%>
				</td>
			</tr>
		
		<tr>
			<td align="right" width="10%">
				公司简介:
			</td>
			<td  colspan="3">
			<%=company_desc%>

			</td>
		</tr>
		



			<tr>
				<td colspan="4">
			   &nbsp;&nbsp;<img src="/program/admin/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">企业联系信息</span>			</td>
		    </tr>

		<tr>
			<td align="right" width="10%">
				联系人姓名:
			</td>
			<td width="30%"><%=contact_name%> &nbsp;&nbsp;
				<%if(contact_sex.equals("1")){%>男<%}%>
				<%if(contact_sex.equals("0")){%>女<%}%>
			</td>
				
			<td align="right" width="15%">
				联系人手机:
			</td>
			<td><%=contact_cellphone%></td>
		</tr>
		
		</tr>
		<tr>
			<td align="right" width="10%">
				联系人部门:
			</td>
			<td><%=contact_depart%></td>
			
						
			<td align="right" width="10%">
				联系人职位:
			</td>
			<td><%=contact_job%></td>
		</tr>

		<tr>
			<td align="right" width="10%">
				联系人MSN:
			</td>
			<td><%=contact_msn%></td>

			<td align="right" width="10%">
				联系人QQ:
			</td>
			<td><%=contact_qq%></td>
		</tr>

		<tr>
			<td align="right" width="10%">
				联系电话:
			</td>
			
			<td><%=phone%></td>
		
			<td align="right" width="10%" >
				传真号:
			</td>
			<td><%=fax%></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				公司地址:
			</td>
			<td><%=company_addr%></td>
			
			<td align="right" width="10%">
				电子邮箱
			</td>
			<td><%=email%></td>
			
		</tr>
		
		<tr>
			<td align="right" width="10%">
				经营地址:
			</td>
			<td><%=business_addr%></td>

			<td align="right" width="10%">
				邮政编码:
			</td>
			<td><%=post_code%></td>
			
		</tr>
		
		<tr>
			<td align="right" width="10%">
				公司网站:
			</td>
			<td colspan="3"><%=website%></td>
			
		
			<tr>
				<td colspan="4">
			   &nbsp;&nbsp;<img src="/program/admin/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">企业详细信息</span>			</td>
		    </tr>
		
		<tr>
			<td align="right" width="10%">
				注册币种:
			</td>
			<td><%=reg_money_type%></td>

			<td align="right" width="10%">
				注册资金:
			</td>
			<td><%=reg_money%></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				工商注册时间:
			</td>
			<td><%=reg_date%></td>

			<td align="right" width="10%">
				注册地:
			</td>
			<td><%=reg_addr%></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				法人代表:
			</td>
			<td><%=corporate%></td>

			<td align="right" width="10%">
				营业执照号:
			</td>
			<td><%=reg_no%></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				纳税人登记号:
			</td>
			<td><%=tax_no%></td>
	
			<td align="right" width="10%">
				进出口企业代码:
			</td>
			<td><%=company_code%></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				开户银行:
			</td>
			<td><%=bank_code%></td>

			<td align="right" width="10%">
				帐号:
			</td>
			<td><%=bank_no%></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				厂房面积:
			</td>
			<td><%=make_sum%></td>
	
			<td align="right" width="10%">
				雇员人数:
			</td>
			<td><%=staff_num%></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				研发部门人数:
			</td>
			<td><%=kwo_num%></td>

			<td align="right" width="10%">
				品牌名称:
			</td>
			<td><%=brand_name%></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				月产量:
			</td>
			<td><%=month_sum%></td>

			<td align="right" width="10%">
				月产单位:
			</td>
			<td><%=month_unit%></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				年进口额:
			</td>
			<td><%=year_in%></td>
		
			<td align="right" width="10%">
				年出口额:
			</td>
			<td><%=year_out%></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				年销售额:
			</td>
			<td><%=year_sum%></td>

			<td align="right" width="10%">
				管理体系认证:
			</td>
			<td><%=man_auth%></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				质量控制:
			</td>
			<td><%=control_type%></td>

			<td align="right" width="10%">
				主要市场:
			</td>
			<td><%=main_market%></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				主要客户群:
			</td>
			<td><%=main_cust%></td>
			
			<td align="right" width="10%">
				是否提供OEM代加工:
			</td>
			<td>
			<%if(isoem.equals("1")){%>是<%}%>
			<%if(isoem.equals("0")){%>否<%}%>
			</td>

		</tr>
	<tr>
		<td  colspan="4">
	   &nbsp;&nbsp;<img src="/program/admin/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">审核信息</span>			
		</td>
	</tr>
	
	<tr>
		<td align="right" width="20%">
			是否通过			
		</td>
		<td colspan="3">    
			<input type="radio" name="up_operating" id="state_code1" onclick="change(0)" checked value="c" />审核通过
			<input type="radio" name="up_operating" id="state_code2" onclick="change(1)" value="b" />审核不通过
		</td>
	</tr>
	
	<tr>
		<td align="right" width="20%" >
			<div id="reson1" style="display:none">不通过理由</div>
		</td>
		<td colspan="3">    
			<div id="reson2" style="display:none"><textarea name="remark" cols="85" rows="10"></textarea></div>
		</td>
	</tr>
		
<input name="cust_id" id="cust_id" value="<%=cust_id%>" type="hidden" />
<input name="cust_state" id="cust_state" value="0" type="hidden" />

	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="hidden" name="bpm_id" value="8342" />
				<input type="hidden" name="pkid" id="pkid" value="<%=cust_id %>" />
				<input type="button"   class="buttoncss" name="tradeSub" onclick="return submitForm()" value="提交" />&nbsp;&nbsp;
				<input type="button"  class="buttoncss"  name="tradeRut" value="返回" onclick="window.location.href='index.jsp';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
